package com.rambler.extension.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("插件模块文档")
                        .version("1.0")
                        .description("提供谷歌插件模块相关的接口"))
                .servers(List.of(
                        new Server().url("/api/extension")  // 关键！告诉 Swagger 请求地址前缀
                ));
    }
}
